package cn.baage.campus.model.dto;

import cn.baage.campus.constant.validation.AddGroup;
import cn.baage.campus.constant.validation.UpdateGroup;
import cn.baage.campus.model.po.Role;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import java.util.Date;
import java.util.List;

/**
 * @Description: 用户信息VO
 * @Author: 八阿哥
 * @url: baage.cn
 * @Version: 1.0
 **/
@Data
@ApiModel(value = "用户信息")
public class UserRoleDTO {


    @TableId(type = IdType.ASSIGN_ID)
    @NotBlank(message = "用户ID不能为空", groups = {UpdateGroup.class})
    @ApiModelProperty(value = "ID")
    private String id;

    @NotBlank(message = "用户名不能为空", groups = {AddGroup.class})
    @ApiModelProperty(value = "用户名")
    private String username;

    @NotBlank(message = "用户密码不能为空", groups = {AddGroup.class})
    @ApiModelProperty(value = "密码")
    private String password;

    @ApiModelProperty(value = "邮箱")
    private String email;

    @ApiModelProperty(value = "手机")
    private String phone;

    @ApiModelProperty(value = "真实姓名")
    private String nickName;

    @ApiModelProperty(value = "头像地址")
    private String avatarUrl;

    @ApiModelProperty(value = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    @ApiModelProperty(value = "更新时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;

    @ApiModelProperty(value = "状态 0:锁定 1:未认证 2:已认证")
    private Integer status;

    @ApiModelProperty(value = "是否删除 0未删除 1已删除")
    private Boolean delFlag;

    @ApiModelProperty(value = "角色信息")
    private List<Role> roles;

}
